import { Route } from 'react-router'
import { IndexRedirect } from 'react-router';
import { WeaErrorPage, WeaLocaleProvider } from 'ecCom'

import store from './stores';
import './style/index';
import './util'

import Home from './components/Home'
import Demo from './components/Demo';
import TaskExecute from './components/task/TaskExecute'
import Add from './components/add'
import ProjectExecute from './components/projectExecute'
import ProjectImport from './components/import'
import MineProject from "./components/mineProject"
import QueryProjectCondition from './components/queryProject/QueryProjectCondition'
import QueryProjectResult from './components/queryProject/QueryProjectResult'
import Approval from "./components/Approval"
import QueryTaskCondition from './components/queryTask/QueryTaskCondition'
import QueryTaskResult from './components/queryTask/QueryTaskResult'
import BatchShare from './components/BatchShare'
import ProjectMonitor from './components/monitor/ProjectMonitor'
import MonitorResult from './components/monitor/MonitorResult'
//任务卡片TaskCard
import TaskCard from './components/task/TaskCard'
//项目卡片
import ProjectCard from './components/project/ProjectCard'
//报表
import ProjectReport from './components/ProjectReport'
//项目看板
import ProjectBoard from "./components/projectBoard";
//项目看板
import App from "./components/App";
import BoardApp from './components/projectBoard/BoardApp';
//项目思维导图
import MindMapPage from "./components/mindmap/MindMapPage";
//项目反馈
import Report from "./components/prjReport";
//项目门户
import ProjectPortal from "./components/portal";
import ProjectPortalCard from "./components/portal/projectCard";
//任务门户
import TasktPortal from "./components/taskportal";
window.prj_store = store;

class Error extends React.Component {
    render() {
        return (
            <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@ua4jks`} msg="对不起，无法找到该页面！" />
        )
    }
}

const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'prj');

const Routes = (
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@4plbls`} path="prj" name="prj" breadcrumbName="项目" onEnter={getLocaleLabel} component={Home}>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@efl441`} path="portal" name="portal" breadcrumbName="项目门户" component={ProjectPortal} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@4le34p`} path="portal/card" name="card" breadcrumbName="项目门户项目卡片" component={ProjectPortalCard} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@dffecz`} path="taskportal" name="taskportal" breadcrumbName="任务门户" component={TasktPortal} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@l07muy`} path="mindmap" name="mindmap" breadcrumbName="项目思维导图" component={MindMapPage} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@2h7198`} path="task" name="task" breadcrumbName="任务执行" component={TaskExecute} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@heaxhj`} path="taskCard" name="taskCard" breadcrumbName="任务卡片" component={TaskCard} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@ezliqz`} path="add" name="add" breadcrumbName="新建项目" component={Add} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@6g2zle`} path="project" name="project" breadcrumbName="项目执行" component={ProjectExecute} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@mmx2kb`} path="projectCard" name="projectCard" breadcrumbName="项目卡片" component={ProjectCard} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@kc2594`} path="import" name="import" breadcrumbName="项目导入" component={ProjectImport} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@q75n2w`} path="mineProject" name="mineProject" breadcrumbName="我的项目" component={MineProject} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@ro7jeq`} path="approval" name="approval" breadcrumbName="审批任务" component={Approval} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@5djli1`} path="queryProject" name="queryProject" breadcrumbName="查询项目" component={QueryProjectCondition} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@7qtpic`} path="queryProjectResult" name="queryProjectResult" breadcrumbName="查询项目结果" component={QueryProjectResult} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@n00afw`} path="queryTask" name="queryTask" breadcrumbName="查询任务" component={QueryTaskCondition} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@v2ypot`} path="queryTaskResult" name="queryTaskResult" breadcrumbName="查询任务结果" component={QueryTaskResult} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@6sqopa`} path="batchShare" name="batchShare" breadcrumbName="批量共享" component={BatchShare} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@8z9137`} path="queryMonitor" name="queryMonitor" breadcrumbName="项目监控" component={ProjectMonitor} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@fkg9jx`} path="monitorResult" name="monitorResult" breadcrumbName="项目监控结果" component={MonitorResult} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@ma4d0q`} path="projectboard" name="projectboard" breadcrumbName="项目看板" component={ProjectBoard} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@1yo49t`} path="board" name="board" breadcrumbName="项目看板" component={BoardApp} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@agzduo`} path="mindmap" name="mindmap" breadcrumbName="项目思维导图" component={MindMapPage} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@wb4jj4`} path="prjReport" name="prjReport" breadcrumbName="项目反馈" component={Report} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@cwlvzb`} name="report" path="report" breadcrumbName="项目报表" >
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@gvo3ne`} name="type" path=":reptype" component={ProjectReport} />
        </Route>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@6xeor9`} path="kanban" component={App} ></Route>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@n5lkhj`} path="demo" component={Demo} ></Route>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@9gh445`} path="*" component={Error}></Route>
    </Route>
);

module.exports = {
    Route: Routes,
    store,
}
